import Layout from '@/layout'

export const constantRoutes = [
	{
		path: '/login',
		component: () => import('@/views/login/index'),
		hidden: true
	},
	{
		path: '/',
		component: Layout,
		redirect: '/dashboard',
		children: [
			{
				name: 'Dashboard',
				path: 'dashboard',
				component: () => import('@/views/dashboard/index'),
				meta: { title: '首页', icon: 'el-icon-house', affix: true }
			}
		]
	},
	{
		path: '/redirect',
		component: Layout,
		hidden: true,
		children: [
			{
				path: '/redirect/:path(.*)',
				component: () => import('@/views/redirect/index')
			}
		]
	}
]

export const asyncRoutes = [
	{
		path: '/Example',
		component: Layout,
		name: 'Example',
		meta: {
			title: 'Example',
			icon: 'el-icon-menu'
		},
		redirect: '/Example/icons',
		children: [
			{
				path: 'icons',
				component: () => import('@/views/icons/index'),
				name: 'Icons',
				meta: { title: 'Icons', noCache: true }
			},
			{
				path: 'buttons',
				component: () => import('@/views/button'),
				name: 'Button',
				meta: { title: 'Button', noCache: true }
			}
		]
	}
]

export default constantRoutes
